package com.bwf.abs;

/**
 * @Version v1.0
 * @Description: TODO
 * @Author ZHANZHONGXIN
 * @Date 2022/5/11 9:53
 * @Copyright 博为峰
 */
//alt + enter
public class Circle extends Shape {
    //直径
    private double diameter;

    public Circle() {
    }

    public Circle(double diameter) {
        this.diameter = diameter;
    }

    public double getDiameter() {
        return diameter;
    }

    public void setDiameter(double diameter) {
        this.diameter = diameter;
    }

    //面积
    public double area() {
        return Math.PI * Math.pow(diameter / 2, 2);
    }

    //周长
    public double perimeter() {
        return Math.PI * diameter;
    }
}
